﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
[CustomEditor(typeof(TestProj))]
public class TestProjEditor : E_ShowButtons<TestProj> { }
#endif
public class TestProj : MonoBehaviour
{
    public Transform onNormal;
    public float onNormalLength;
    public Transform vector;
    public float vectorLength;
    public Transform projection;
    [ShowButton]
    void Update()
    {
        projection.position = Vector3.Project(vector.up * vectorLength, onNormal.up * onNormalLength);
    }
}
